# coding=utf-8
import random

if __name__ == '__main__':
    source = [random.randint(0, 100) for i in range(40)]
    print(source)
    num = len(source)
    sum_num = sum(source)
    ave_num = sum_num / num
    print(ave_num)
    leave_ave = len([i for i in source if i < ave_num])
    print(leave_ave)
    source.sort()
    print(source)